package com.dp.mallchat.common.common.event.listener;

import com.dp.mallchat.common.common.constant.MQConstant;
import com.dp.mallchat.common.common.event.ReCallMsgEvent;
import com.dp.mallchat.common.user.service.adapter.WSAdapter;
import com.dp.mallchat.common.user.service.impl.PushService;
import com.dp.mallchat.transaction.service.MQProducter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @Author: dupeng
 * @CreateTime: 2024-07-08  20:11
 * @Description: 撤回消息事件监听
 */
@Service
public class ReCallMsgEventListener {

    @Autowired
    private PushService pushService;

    @Async
    @EventListener(classes = ReCallMsgEvent.class)
    public void onReCallMsgEvent(ReCallMsgEvent event) {
        //ws推送撤回事件
        pushService.sendPushMsg(WSAdapter.buildReCallMsg(event.getReCallResp()));
    }



}
